package com.ecoolex.ying.space.core.manager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ecoolex.framework.message.queue.Message;
import com.ecoolex.framework.message.queue.ProducerManager;

@Component
public class ProducerService {

	@Autowired
    private ProducerManager producerManager;
	
	/**
	 * 用户点赞作品统计消息
	 * @param worksId
	 */
	public void sendUserLikeUserWorksCreate(Integer worksId) {
        producerManager.sendAsync(new Message("ying.space.user.like.user.works.create", String.valueOf(worksId)));
    }
	
	/**
	 * 用户取消点赞作品统计消息
	 * @param worksId
	 */
	public void sendUserLikeUserWorksCancel(Integer worksId) {
        producerManager.sendAsync(new Message("ying.space.user.like.user.works.cancel", String.valueOf(worksId)));
    }
	
	/**
	 * 用户点赞评论统计消息
	 * @param commentId
	 */
	public void sendUserLikeUserWorksCommentCreate(Integer commentId) {
        producerManager.sendAsync(new Message("ying.space.user.like.user.works.comment.create", String.valueOf(commentId)));
    }
	
	/**
	 * 用户取消点赞评论统计消息
	 * @param commentId
	 */
	public void sendUserLikeUserWorksCommentCancel(Integer commentId) {
        producerManager.sendAsync(new Message("ying.space.user.like.user.works.comment.cancel", String.valueOf(commentId)));
	}
}
